Conditions | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import path from 'path'; |
||
4 | |||
5 | export function load(relPath, clearCache) { |
||
6 | const absPath = path.resolve(entry, relPath); |
||
7 | |||
8 | if (clearCache) delete require.cache[require.resolve(absPath)]; |
||
9 | // eslint-disable-next-line security/detect-non-literal-require |
||
10 | const result = require(absPath); |
||
11 | |||
12 | if (clearCache) delete require.cache[require.resolve(absPath)]; |
||
13 | |||
14 | return result; |
||
15 | } |
||
51 |